server {
    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/fei78.me/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/fei78.me/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

	# Add index.php to the list if you are using PHP
	index index.html index.htm index.nginx-debian.html, index.php;
    server_name fei78.me www.fei78.me; # managed by Certbot

	location / {
        root /var/www/html;
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	}

    include /etc/nginx/fastcgi_for_moodle.conf;

	#location ~ /\.ht {
	#	deny all;
	#}
}
server {
    if ($host = www.fei78.me) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = fei78.me) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


	listen 80 ;
	listen [::]:80 ;
    server_name fei78.me www.fei78.me;
    return 404; # managed by Certbot
}
